import numpy as np
import json
import os

if __name__ == '__main__':
    with open('command.json', 'r') as f:
        command_m = json.load(f)
    print(command_m)
    for ds_name in command_m:
        if ds_name == 'text-to-image' or ds_name == 'tiny5m':
            tmp_block = command_m[ds_name]
            for dist_func in tmp_block:
                cmd = tmp_block[dist_func]
                print(cmd)
                # os.system('cd ../build && nohup %s > %s_%s.log 2>&1 &' % (cmd, ds_name, dist_func))
                os.system('cd ../build && %s' % (cmd))
